home *** CD-ROM | disk | FTP | other *** search
- #include <windows.h>
- #include <winsock2.h>
-
-
- //
- // WS2SETUP_DONT_INSTALL_COMPONENT : do not under any circumstances install
- // the microsoft version of this component
- //
- // WS2SETUP_INSTALL_COMPONENT : install the microsoft version of this
- // component if & only if a competing vendor's version of this
- // product is not installed
- //
- // WS2SETUP_UPGRADE_COMPONENT : upgrade the microsoft version of this
- // component if & only if it is already installed (no error otherwise)
- //
-
- #define WS2SETUP_DONT_INSTALL_COMPONENT 0
- #define WS2SETUP_INSTALL_COMPONENT 1
- #define WS2SETUP_UPGRADE_COMPONENT 2
-
- typedef struct _VENDOR_WS2SETUP_OPTIONS // Defaults:
- {
- DWORD dwSize; // sizeof (VENDOR_WS2SETUP_OPTIONS)
-
- DWORD dwInstallMicrosoftTCP; // WS2SETUP_INSTALL_COMPONENT
-
- DWORD dwInstallMicrosoftIPX; // WS2SETUP_UPGRADE_COMPONENT
-
- BOOL bShowWS2SetupUI; // TRUE
-
- DWORD dwInstallMicrosoftDNS; // WS2SETUP_INSTALL_COMPONENT
-
- DWORD dwInstallMicrosoftSAP; // WS2SETUP_DONT_INSTALL_COMPONENT
-
- LPCSTR lpszWSock32DllLegalCopyright; // NULL
-
- } VENDOR_WS2SETUP_OPTIONS, FAR *LPVENDOR_WS2SETUP_OPTIONS;
-
-
- HINSTANCE ghDLL;
-
-
- BOOL
- WINAPI
- DllMain(
- HINSTANCE hDLL,
- DWORD dwReason,
- LPVOID lpReserved
- )
- {
- switch (dwReason)
- {
- case DLL_PROCESS_ATTACH:
-
- ghDLL = hDLL;
-
- case DLL_PROCESS_DETACH:
-
- break;
-
- }
-
- return TRUE;
- }
-
-
- VOID
- WSAAPI
- VendorGetSetupOptions(
- LPVENDOR_WS2SETUP_OPTIONS pOptions
- )
- {
- //
- // Munge the options per your requirements
- //
- // If you are wanting Winsock2 setup to install over your
- // existing Winsock installation (your private WSOCK32.DLL)
- // then set pOptions->lpszWSock32DllLegalCopyright to point
- // to a static string containing your version Copyright
- // string.
- //
- // NOTE: A valid copyright string consists of one or more
- // NULL-terminated ascii strings, terminated by
- // two NULL characters, i.e. : "string1\0string2\0\0"
- //
-
- char buf[140];
-
- wsprintf (buf, "pOptions=x%x", pOptions);
- MessageBox (NULL, buf, "VendorGetSetupOptions: enter",MB_OK);
- return;
- }
-
-
- LONG
- WSAAPI
- VendorInstallProvider(
- int (WSAAPI *pfnWSCDeinstallProvider)(),
- int (WSAAPI *pfnWSCEnumProtocols)(),
- int (WSAAPI *pfnWSCGetProviderPath)(),
- int (WSAAPI *pfnWSCInstallProvider)()
- )
- {
- char buf[140];
-
- wsprintf(
- buf,
- "pfnDeinst=x%x, pfnEnum=x%x, pfnGetPath=x%x, pfnInst=x%x",
- pfnWSCDeinstallProvider,
- pfnWSCEnumProtocols,
- pfnWSCGetProviderPath,
- pfnWSCInstallProvider
- );
-
- MessageBox (NULL, buf, "VendorInstallProvider: enter",MB_OK);
- return 0; // return the # providers installed
- }
-
-
- LONG
- WSAAPI
- VendorInstallNameSpace(
- int (WSAAPI *pfnWSCEnableNSProvider)(),
- int (WSAAPI *pfnWSCInstallNameSpace)(),
- int (WSAAPI *pfnWSCUnInstallNameSpace)()
- )
- {
- char buf[140];
-
- wsprintf(
- buf,
- "pfnEnable=x%x, pfnInst=x%x, pfnUnInst=x%x",
- pfnWSCEnableNSProvider,
- pfnWSCInstallNameSpace,
- pfnWSCUnInstallNameSpace
- );
-
- MessageBox (NULL, buf, "VendorInstallProvider: enter",MB_OK);
- return 0; // return the # name spaces installed
- }
-
-
- VOID
- WSAAPI
- VendorCompleteWS2Install(
- LONG lResult
- )
- {
- char buf[64];
-
- wsprintf (buf, "lResult=x%x", lResult);
- MessageBox (NULL, buf, "VendorCompleteWS2Install: enter", MB_OK);
- return;
- }
-